package com.liuxingwu.diy;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

/**
 * 使用方式三：注解实现AOP
 *
 * @author 扫地生_LiuXingWu
 */
// 声明该类是一个切面
@Aspect
public class AnnotationPointCut {
    // 通知注释
    @Before("execution(* com.liuxingwu.service.UserServiceImpl.*(..))")
    public void before() {
        System.out.println("=================方法执行前===================");
    }

    @After("execution(* com.liuxingwu.service.UserServiceImpl.*(..))")
    public void after() {
        System.out.println("=================方法执行后===================");
    }
}
